package com.shiguiwu.springmybatis.spring.autowired.Generics;

import com.shiguiwu.springmybatis.spring.autowired.AConfig;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * @description: 泛型注入
 * @author: stone
 * @date: Created by 2021/3/15 15:56
 * @version: 1.0.0
 * @pakeage: com.shiguiwu.springmybatis.spring.autowired.Generics
 */
public class GenericsTests {

    public static void main(String[] args) {
        AnnotationConfigApplicationContext applicationContext = new AnnotationConfigApplicationContext(GenericsConfig.class);
        String[] beanDefinitionNames = applicationContext.getBeanDefinitionNames();
        for (String beanDefinitionName : beanDefinitionNames) {
            System.out.println(applicationContext.getBean(beanDefinitionName));

        }

        System.out.println("===============================================");

        System.out.println(applicationContext.getBean(AService.class).getDao());
        System.out.println(applicationContext.getBean(BService.class).getDao());
    }
}
